﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SWSoft.Framework;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using Tools.Unity;
using SWSoft.Reflector;
using MediSIIM.BizComponent.ZheJiangSZYBInterface;

namespace ToolLoader
{
    public partial class Form1 : Form
    {
        DataRead read = new DataRead();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            test();
            var table = read.BXLBXX();
            for (int i = 0; i < table.Count; i++)
            {
                if (File.Exists(Application.StartupPath + "\\" + table[i].HZSRM3 + "\\" + table[i].HZSRM3 + ".exe"))
                {
                    var viewitem = new ListViewItem(table[i].YLBXMC, 0);
                    viewitem.Tag = table[i];
                    listViewBuffer1.Items.Add(viewitem);
                }
            }
        }

        private void test()
        {
            var indata = "$$" +
                "~~~~"+28+"~"+"23040698382914"+"~2"+"~"+
            "$$";
            string outdata = string.Empty.PadRight(8000);
            string lpdata = string.Empty;
            YiBaoJKDLL.YbInit();
            YiBaoJKDLL.f_UserBargaingApply(49, 0, indata, ref outdata, lpdata);
        }


        private void listViewBuffer1_MouseDoubleClick(object sender, MouseEventArgs e)
        {

            var datarow = listViewBuffer1.SelectedItems[0].Tag as YB_BXLBXX;
            Process.Start(Application.StartupPath + "\\" + datarow.HZSRM3 + "\\" + datarow.HZSRM3 + ".exe", datarow.YLBXID + " " + datarow.YBYYDM);
            Application.Exit();
        }
    }
}
